public class project {
    public String convert(String s, int numRows) {
        int len=s.length();
        if(numRows==1||numRows>=len){
            return s;
        }
        StringBuilder[] sb=new StringBuilder[numRows];
        for(int i=0;i<numRows;i++){
            sb[i]=new StringBuilder();
        }
        for(int i=0,x=0,t=numRows*2-2;i<len;i++){
            sb[x].append(s.charAt(i));
            if(i%t<numRows-1){
                x++;
            }else{
                x--;
            }
        }
        StringBuilder ret=new StringBuilder();
        for(StringBuilder tmp:sb){
            ret.append(tmp);
        }
        return ret.toString();
    }
}
